<?php

/**
 * IndexController - The default controller class
 *
 * @author
 * @version
 */

require_once 'Zend/Controller/Action.php';

class LogoSeachController extends Zend_Controller_Action
{




    public function init()
    {



    }

    public function preDispatch()
    {

        $this->view->addHelperPath(MY_ROOT.'/vhelpers');

        Zend_Controller_Action_HelperBroker::addPath(MY_ROOT.'/chelpers');

        $this->getHelper('Nav')->getHeaderNav();

        $this->getHelper('User')->getinfo($this->_request->getModuleName(),$this->_request->getControllerName());

    }


    public function indexAction()
    {

        $cateString=file_get_contents(MY_ROOT.'/html/upload/category/category.txt');

        $cateArray=array();

        if($cateString!='')
        {

            $cateArray=json_decode($cateString,true);

        }
        $leftmenuopen=1;
        $this->view->assign('leftmenuopen',$leftmenuopen);
        $topbeanopen=1;
        $this->view->assign('topbeanopen',$topbeanopen);
        
       //广告
        $ad =new CItem();
        $aditemArray=$ad->getAllItems(0,5,'ad');
         $this->view->assign('aditemArray',$aditemArray);

        $leftimgmenuString=file_get_contents(MY_ROOT.'/html/upload/turn_round/leftimgmenu.txt');
       $leftmenuArray=array();

       $leftmenuArray=json_decode($leftimgmenuString,true);
       $newleftmenuArray=$leftmenuArray['imgUrl'];
       $newHrefArray=$leftmenuArray['imgHref'];

        for($i=0;$i<count($leftmenuArray['ordering']);$i++)
        {
            $leftmenuArray['imgUrl'][$leftmenuArray['ordering'][$i]]=$newleftmenuArray[$i];
        }
        for($i=0;$i<count($leftmenuArray['imgUrl']);$i++)
        {
            $leftmenuArray['imgHref'][$leftmenuArray['ordering'][$i]]=$newHrefArray[$i];
        }
        $this->view->assign('leftmenuArray',$leftmenuArray);

        $item=new CItem();

        $this->getHelper('Fenlei')->getCategories();


        $imgString=file_get_contents(MY_ROOT.'/html/upload/turn_round/logos.txt');

        $imgArray=array();

        $imgArray=json_decode($imgString,true);

        $newImgArray=$imgArray['imgUrl'];

        $newHrefArray=$imgArray['imgHref'];

        $this->view->assign('imgArray',$imgArray);
    

        $order=new COrder();

        $orderArray=$order->getAllOrders(0,8,0);

        $this->view->assign('orderArray',$orderArray);


        $bulletinArray=$item->getAllItems(0,10,'bulletin');

        $this->view->assign('bulletinArray',$bulletinArray);

        $this->view->assign ( "website_description", "Jersey,clothes" );

    //$this->view->assign ( "website_title", "Jersey shopping mall" );

    }
    public function getlocationajaxAction()
    {

        $this->_helper->viewRenderer->setNoRender();

        $this->getHelper ('layout')->disableLayout ();

        $pid=$this->_request->getParam('pid',0);

        $location=new CFenlei('location');

        $fenleiArray=$location->getFenleiByPid($pid);

        echo json_encode($fenleiArray);

    }

}
